"""
RagFlow 客户端 GUI 批量上传功能模块
"""

from PySide6.QtWidgets import QMessageBox, QWidget, QVBoxLayout
from ragflow_client.gui.features.base_feature import BaseFeature


class BatchUploadFeature(BaseFeature):
    """批量上传功能类"""
    
    def __init__(self, parent=None):
        """初始化批量上传功能"""
        super().__init__(parent)
    
    def execute(self):
        """执行批量上传功能"""
        # 检查API配置
        if not self.check_api_config():
            return
            
        # 创建批量上传窗口
        content_widget = QWidget()
        layout = QVBoxLayout(content_widget)
        
        # 创建批量上传选项卡组件
        from ragflow_client.gui.components.batch_upload_tab import BatchUploadTabWidget
        batch_upload_tab = BatchUploadTabWidget(self.parent)
        layout.addWidget(batch_upload_tab)
        
        # 创建窗口
        self.window = self.create_window("批量上传", content_widget)
        self.window.show()
    
    # 使用基础功能类中的check_api_config方法
